/**
 * @param {string} num1
 * @param {string} num2
 * @return {string}
 */
var addStrings = function (num1, num2) {
  let longStr, shortStr;
  if (num1.length < num2.length) {
    shortStr = num1
    longStr = num2
  } else {
    shortStr = num2
    longStr = num1
  }
  longStr = longStr.split('').reverse()
  shortStr = shortStr.split('').reverse()
  let carry = 0
  let i = 0
  for (; i < shortStr.length; i++) {

    let res = Number(shortStr[i]) + Number(longStr[i]) + carry
    carry = Math.floor(res / 10)
    longStr[i] = res % 10
  }

while (carry) {
  let res = Number(longStr[i]?longStr[i]:0) + 1
    longStr[i] = res%10
    carry =Math.floor(res/10)
    i++
  }

  return longStr.reverse().join('')


};

addStrings('6994', '36')